package android.slc.icr.core;

import android.slc.icr.core.entity.IcrChartRoom;
import android.slc.icr.core.entity.IcrMessage;
import android.slc.icr.core.room.manager.IChartRoomManager;
import android.slc.icr.service.IcrMessageRemoteService;
import android.slc.icr.service.IcrPersistenceService;

import java.util.List;

/**
 * 聊天室管理器
 */
public interface IIcrManager {
    /**
     * 初始化
     */
    void init(IcrMessageRemoteService icrMessageRemoteService, IcrPersistenceService icrPersistenceService);

    /**
     * 注册roomManager
     */
    void registerRoomManager(IChartRoomManager roomManager);

    /**
     * 查找房间管理器类型
     *
     * @param roomManagerType
     * @param <T>
     * @return
     */
    <T extends IChartRoomManager> T findRoomManager(String roomManagerType);

    /**
     * 接收消息
     *
     * @param message
     */
    void receiveMessage(IcrMessage message);

    /**
     * 获取所有聊天室信息
     *
     * @return
     */
    List<IcrChartRoom> getChartRoomList(String msgType);

    /**
     * 获取所有聊天室信息
     *
     * @return
     */
    List<IcrChartRoom> getChartRoomListByCreateUser(String msgType, String createUser);

    /**
     * 根据房间id查询聊天室信息
     *
     * @param roomId
     * @return
     */
    IcrChartRoom findChartRoomByRoomId(String roomId, String msgType);

}
